package com.roamer.school.repository.entity.sys;


import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.roamer.school.repository.entity.BaseEntity;
import com.roamer.school.repository.enums.ResourceTypeEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * 权限信息
 *
 * @author roamer
 * @version V1.0
 * @date 2018/12/26 22:28
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("sys_resource")
public class SysResource extends BaseEntity<SysResource> {

    private static final long serialVersionUID = 1L;

    /** 资源名称 */
    private String name;

    /**
     * 资源路径
     * <p>唯一约束</p>
     */
    private String url;

    /** 父编号 */
    private Long parentId;


    /** 资源类型 */
    private ResourceTypeEnum type;

    /**
     * 权限字符串
     * <p>menu 例子：role:*</p>
     * <p>button 例子：role:create,role:update,role:delete,role:view</p>
     */
    private String perms;

    /**
     * 菜单图标
     */
    private String icon;

    /** 是否启用 */
    @TableField(exist = false)
    private Boolean available;

    /**
     * 排序
     */
    private Integer orderNum;

}
